import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from './components/home/Home'
import City from './components/city/City'
import Detail from './components/detail/Detail'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    component: Home
  },
  {
    path: '/city',
    component: City
  },
  {
    path: '/detail/:id',
    component: Detail
  }
]

const router = new VueRouter({
  routes,
  scrollBehavior (to, from, savedPosition) {
    return { x: 0, y: 0 }
  }
})

export default router
